LogErrorMessage.m 707 B

1234567891011121314151617
  1. %================================================================%
  2. % Logs error messages into ErrorLogs for pipeline: %
  3. % When multiple workers are open, "fprintf" within a parfor loop %
  4. % will not write to files properly. Nest it in this function. %
  5. % Last modified: Sept. 24, 2014 %
  6. %================================================================%
  7. % This file is a part of the MEG & PLS Pipeline (MEGPLS). For more
  8. % details, see the documentation included with the software package.
  9. function LogErrorMessage(ErrorMessage, RunSection)
  10. LoadErrLog = fopen(['ErrorLog_',RunSection,'.txt'], 'a');
  11. fprintf(LoadErrLog, ErrorMessage);
  12. fclose(LoadErrLog);